package com.twu.biblioteca;

import org.springframework.stereotype.Component;

import java.util.InputMismatchException;
import java.util.Scanner;

@Component
public class Reader {

    private Scanner input;

    public Reader() {
        input = new Scanner(System.in);
    }

    public UserInputOptions readUserSelection() {
        int pressedInt = input.nextInt();
        return UserInputOptions.valueOf(pressedInt);
    }

    public String readStringInput() {
        return input.next();
    }
}
